package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzZbdongtaiMapper;
import com.ruoyi.system.domain.DzZbdongtai;
import com.ruoyi.system.service.IDzZbdongtaiService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 周边楼盘动态Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-16
 */
@Service
public class DzZbdongtaiServiceImpl implements IDzZbdongtaiService 
{
    @Autowired
    private DzZbdongtaiMapper dzZbdongtaiMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询周边楼盘动态
     * 
     * @param ssId 周边楼盘动态主键
     * @return 周边楼盘动态
     */
    @Override
    public DzZbdongtai selectDzZbdongtaiBySsId(Long ssId)
    {
        return dzZbdongtaiMapper.selectDzZbdongtaiBySsId(ssId);
    }

    /**
     * 查询周边楼盘动态列表
     * 
     * @param dzZbdongtai 周边楼盘动态
     * @return 周边楼盘动态
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzZbdongtai> selectDzZbdongtaiList(DzZbdongtai dzZbdongtai)
    {

        return dzZbdongtaiMapper.selectDzZbdongtaiList(dzZbdongtai);
    }

    @Override
    public List<DzZbdongtai> selectDzZbdongtaiListWeb(DzZbdongtai dzZbdongtai)
    {
        return dzZbdongtaiMapper.selectDzZbdongtaiList(dzZbdongtai);
    }

    /**
     * 新增周边楼盘动态
     * 
     * @param dzZbdongtai 周边楼盘动态
     * @return 结果
     */
    @Override
    public int insertDzZbdongtai(DzZbdongtai dzZbdongtai)
    {
        dzZbdongtai.setCreateTime(DateUtils.getNowDate());
        return dzZbdongtaiMapper.insertDzZbdongtai(dzZbdongtai);
    }

    /**
     * 修改周边楼盘动态
     * 
     * @param dzZbdongtai 周边楼盘动态
     * @return 结果
     */
    @Override
    public int updateDzZbdongtai(DzZbdongtai dzZbdongtai)
    {
        return dzZbdongtaiMapper.updateDzZbdongtai(dzZbdongtai);
    }

    /**
     * 批量删除周边楼盘动态
     * 
     * @param ssIds 需要删除的周边楼盘动态主键
     * @return 结果
     */
    @Override
    public int deleteDzZbdongtaiBySsIds(Long[] ssIds)
    {
        return dzZbdongtaiMapper.deleteDzZbdongtaiBySsIds(ssIds);
    }

    /**
     * 删除周边楼盘动态信息
     * 
     * @param ssId 周边楼盘动态主键
     * @return 结果
     */
    @Override
    public int deleteDzZbdongtaiBySsId(Long ssId)
    {
        return dzZbdongtaiMapper.deleteDzZbdongtaiBySsId(ssId);
    }
}
